<%-- 
    Document   : soa
    Created on : Apr 29, 2012, 4:03:03 PM
    Author     : Jayson Kiong
--%>

<%@page import="java.text.DecimalFormat"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Model.Soa"%>
<%@page import="Model.Loan"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="Cache-Control" content="no-cache">
        <meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
        <link rel = "stylesheet" type = "text/css" href = "quicklendstyle.css"/>
        <link rel="stylesheet" type="text/css" href="css/jquery.datepick.css" id="theme">
        <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" />
	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.19.custom.min.js"></script>
        <script type="text/javascript" src="js/jquery.datepick.js"></script>
        <script type="text/javascript" src="quicklendjs.js"></script>
        
	<script type="text/javascript">
		$(function(){

			// Accordion
			$("#accordion").accordion({ header: "h3" });
                        
                        // Accordion
			$("#accordion2").accordion2({ header: "h3" });

			// Tabs
			$('#tabs').tabs();

			// Dialog
			$('#dialog').dialog({
				autoOpen: false,
				width: 600,
				buttons: {
					"Ok": function() {
						$(this).dialog("close");
					},
					"Cancel": function() {
						$(this).dialog("close");
					}
				}
			});
				// Dialog Link
			$('#dialog_link').click(function(){
				$('#dialog').dialog('open');
				return false;
			});
				// Datepicker
			$('#datepicker').datepicker({
				inline: true
			});
				// Slider
			$('#slider').slider({
				range: true,
				values: [17, 67]
			});
				// Progressbar
			$("#progressbar").progressbar({
				value: 20
			});
				//hover states on the static widgets
			$('#dialog_link, ul#icons li').hover(
				function() { $(this).addClass('ui-state-hover'); },
				function() { $(this).removeClass('ui-state-hover'); }
			);
			});
                        
                          
	</script>
        <script type="text/javascript">
            $(function(){
             $('#statusdate').datepick();
             $('#rebilldate').datepick();
              });
        </script>
       
        
        
        <title>Statement of Account</title>
    </head>
    <body>
        <%
        float loanamount, collectionsum;
        String clientname, comakername, loantype, statusdate, rebilldate;
        DecimalFormat df = new DecimalFormat("0.00");
        int loanno=0, arctr=0;
        Soa soa = new Soa();
        ArrayList soaar = (ArrayList)session.getAttribute("soa");
        int soaarsize = 0;
        
        if(soaar!=null){
            soa = (Soa)soaar.get(0);
            soaarsize = soaar.size();
        }
        
        if(request.getParameter("loanno")!=null){
            loanno=Integer.parseInt(request.getParameter("loanno"));
        }
        if(soa.getfCollectionsum()!=0f){
            collectionsum = soa.getfCollectionsum();
        }else{
            collectionsum=0f;
        }
        
        if(soa.getStrLoantype()!=null){
            loantype = soa.getStrLoantype();
        }else{
            loantype="";
        }
        
        if(soa.getStrStatusdate()!=null){
            statusdate = soa.getStrStatusdate();
        }else{
            statusdate="";
        }
        
        if(soa.getStrRebilldate()!=null){
            rebilldate = soa.getStrRebilldate();
        }else{
            rebilldate="";
        }
        
        if(soa.getfLoanamount()!=0f){
              loanamount = soa.getfLoanamount();
          }else{
              loanamount = 0f;
          }
        if(soa.getStrClientname()!=null){
              clientname = soa.getStrClientname();
          }else{
              clientname = "";
          }
        if(soa.getStrComakername()!=null){
              comakername = soa.getStrComakername();
          }else{
              comakername = "";
          }
        %>
        <div id="head" style="position:absolute;top:12px;left:25px; font-family:segoe ui;font-size:20px;color:#EBBD05;font-weight:600">
            Statement of Account
        </div>
        <div id="loandetails" style="position:absolute;top:10px;left:25px;width:500px;">
                    <div id="soaloanno" style="position:absolute; top: 55px; left:25px; font-size:16px">
                        Loan No. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" readonly="true" value="<%=loanno%>"style="width:130px;height:20px;font-weight:600;color:#009900" onKeyPress="validate(event)"><input type="button" value="Search" onClick="searchLoan()"/>    
                    </div>
                    <div id="type" style="position:absolute; top:110px; left:25px;">
                        Loan Type:    &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" readonly="true" value="<%=loantype%>"style="width:130px;height:15px;height:18px;font-family: Segoe UI;font-size:16px;"></input>&nbsp;&nbsp;&nbsp;&nbsp;Term:&nbsp;&nbsp; <input type="text" readonly="true" value="<%=soa.getiTerms()%>" style="top:50px;width:130px;height:18px;font-family: Segoe UI; font-size:16px;text-align:right;" onKeyPress="validate(event)"></input><br style="line-height:30px;"/>   
                        PN/Month: &nbsp;&nbsp;&nbsp; <input type="text" readonly="true" value="<%=df.format(soa.getfPnmonth())%>"style="top:50px;width:180px;height:18px;font-family: Segoe UI;  font-size:16px;text-align:right;" onKeyPress="validate(event)"></input><br style="line-height:30px;"/>
                        
                    </div>

                    <div id="loanamount" style="position:absolute; top:190px; left:25px;">
                        Loan Amount:&nbsp;&nbsp;&nbsp;<input type="text" readonly="true" value="<%=df.format(loanamount)%>"style="top:50px;width:180px;height:18px;font-family: Segoe UI; font-weight: bold; font-size:16px;text-align:right;" onKeyPress="validate(event)"></input><br style="line-height:30px;"/>
                    </div>              
                    
        </div>
        <div id="borrowerdetails" style="position:absolute;top:10px; left:510px; width:400px">
                    
                    <div id="borrowertitle" style="position:absolute; top:55px; left:25px; ">
                        Borrower's Information
                    </div>
                    <div id="borrowername" style="position:absolute; top:87px; left:24px;">
                        Account No.&nbsp;&nbsp;&nbsp;<input type="text" readonly="true" value="<%=soa.getiClientid()%>"style="width:160px;height:15px;font-weight:600;color:#FF0000"><br style="line-height:30px;"/>
                        
                        Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input value="<%=clientname%>" readonly="true" type="text" style="width:160px;height:15px;">
                    </div>
                    <div id="borrowertitle" style="position:absolute; top:147px; left:25px; ">
                        Co-Maker's Information
                    </div>
                    <div id="borrowername" style="position:absolute; top:177px; left:24px;">
                        Account No.&nbsp;&nbsp;&nbsp;<input type="text" readonly="true" value="<%=soa.getiComakerid()%>"style="width:160px;height:15px;font-weight:600;color:#FF0000"><br style="line-height:30px;"/>
                        
                        Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" readonly="true" value="<%=comakername%>"style="width:160px;height:15px;">
                    </div>
                    
                    
                    
                    
        </div>
       
        <div id="table" style="position:absolute; top:250px; left:50px; font-family: segoe ui; font-size:11px;overflow: auto; width: 800px; height: 120px; padding:0px; margin: 0px; ">
                        <table border="1" cellspacing=0 cellpadding=2 style="height:70px">
                        <tr>
                            
                            <th width=250 bgcolor="lightgrey">Start Date</th>
                            <th width=250 bgcolor="lightgrey">Monthly</th>
                            <th width=230 bgcolor="lightgrey">Due Date</th>
                            <th width=250 bgcolor="lightgrey">Amount Due</th>
                            <th width=250 bgcolor="lightgrey">Collection</th>
                            <th width=250 bgcolor="lightgrey">Comaker Pay</th>
                            <th width=250 bgcolor="lightgrey">FC Percent</th>
                            <th width=250 bgcolor="lightgrey">FC</th>
                            <th width=250 bgcolor="lightgrey">Cash Pay</th>
                            <th width=250 bgcolor="lightgrey">Refund</th>
                            <th width=250 bgcolor="lightgrey">Balance</th>     
                        </tr>
                         <%arctr=0;
                        
                          for(int x=0;x<soaarsize;x++){
                          soa=(Soa)soaar.get(arctr); 
                            %>
                            <tr><td><%=soa.getStrStartdate()%></td><td><%=df.format(soa.getfMonthly())%></td><td><%=soa.getStrDuedate()%></td><td><%=df.format(soa.getfAmountdue())%></td><td><%=df.format(soa.getfCollection())%></td><td><%=df.format(soa.getfComakerpay())%></td><td><%=soa.getfPercent()%><td><%=df.format(soa.getfFc())%></td><td><%=df.format(soa.getfCashpay())%></td><td><%=df.format(soa.getfRefund())%></td><td><%=df.format(soa.getfBalance())%></td></tr>
                          <%arctr++;}%>
                        
                        </table>
        </div>
        
        <div id="remainingbalance" style="position:absolute;top:380px; left:45px; font-weight:600;font-family:segoe UI; font-size:12px">
            Remaining Balance(PhP):&nbsp;&nbsp;<input type="text" value="<%=df.format(loanamount-collectionsum)%>"style="width:130px;height:15px;font-family: Segoe UI; font-weight: bold; font-size:16px;text-align:right;" readonly="true"></input>
        </div>
        
        <div id="remarks" style="position:absolute;top:420px; left:45px; font-family:segoe UI; font-size:12px">
            Notes/Remarks:<br style="line-height:30px;"/>
            <textarea rows="5" cols="35" style="resize: none;">
            </textarea>
        </div>
        
        <div id="loanstatus" style="position:absolute; top:380px; left:370px;font-family:segoe UI; font-size:14px">
            <table>
                <tr>
                    <td>Loan Status:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select name="loanstatus" style="width:135px;font-family:Segoe UI;">
                                                <option value="GOODACCOUNT">GOOD ACCOUNT</option>
                                                </select>
                    </td>        
                </tr>
                <tr>
                    <td>
                        Status Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="statusdate" value="<%=statusdate%>" type="text" style="width:130px;height:15px;">&nbsp;&nbsp;&nbsp;Rebill Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="rebilldate" value="<%=rebilldate%>" type="text" style="width:130px;height:15px;">
                    </td>
                </tr>
                <tr>
                    <td>
                        Rebill Amount:&nbsp;&nbsp;<input type="text" value="<%=df.format(soa.getfRebillamount())%>" style="width:130px;height:15px;">&nbsp;&nbsp;&nbsp;&nbsp;Rebill Co. Amount:&nbsp;&nbsp;<input type="text" value="<%=df.format(soa.getfRebillcoamount())%>"style="width:130px;height:15px;">
                    </td>    
                </tr>
                <tr>
                    <td>
                    Rebill Status:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select name="loanstatus" style="width:135px;font-family:Segoe UI;">
                                        <option value="NOTAPPLICABLE">NOT APPLICABLE</option>
                                    </select>
                    </td>
                     
                </tr>
           
            </table>
            
        </div>
        
        <div id="soabutton"  style="position:absolute; top:530px; left:530px;">
            <input type="image" name="newentrybtn"  src="images/newentryimage.png" size="13" style="position:absolute; left:170px" onclick="checkSoa(<%=loanno%>)"/>
        </div>
             
    </body>
</html>
